<template>
  <div class="tab_wrap">
    <div class="tabbar">
      <ul>
        <li v-for="(item, i) in clusterCodeList" :key="i">
          <a :class="index == i ? 'active':''" @click="tabList(i)">
            <span>{{ item.clusterName }}</span>
          </a>
        </li>
      </ul>
    </div>
    <p class="line">

        

      <span class="bar"></span>
    </p>
  </div>
</template>

<script>
export default {
    data(){
        return{
            index:0
        }
    },
  props: {
    clusterCodeList: {
      type: Array,
    },
  },
  methods:{
      tabList(i){
          this.index = i
          let clusterCode = this.clusterCodeList[i].clusterCode
          
          this.$emit('get-updata',{clusterCode:clusterCode,index:this.index})
      }
  }
};
</script>

<style lang="scss" scoped>
.tabbar::-webkit-scrollbar {
  display: none;
}
.tab_wrap {

  .tabbar {
    width: 100%;
    height: 50px;
    overflow-x: auto;
    background-color: #fff;
    ul {
      display: flex;

      li {
        flex-shrink: 0;
        a {
          display: block;
          padding: 0 14px;
          color: #a3a3a3;
          height: 50px;
          text-align: center;
          line-height: 58px;
          font-size: 14px;
          transition: all 0.3s ease;
          
        }
         a.active{
             font-size: 18px;
              font-weight: 500;
              color:#f86442 ;
         }
      }
    }
  }

  .line{
      height: 1px;
      background-color: #f3f4f5;

  }
}
</style>

